//
//  COHotHeadReusableView.swift
//  CocoProject
//
//  Created by Vill on 2023/11/7.
//

import UIKit

class COHotHeadReusableView: UICollectionReusableView {
    
    lazy var headImg: UIImageView = {
        let top = UIImageView()
        top.layer.masksToBounds = true
        top.layer.cornerRadius = PTW(10)
        top.contentMode = .scaleAspectFill
        return top
    }()
    
    lazy var upLbl: UILabel = {
        let tip = UILabel()
        tip.backgroundColor = .white
        tip.text = "Upgrade new App"
        tip.font = UIFont.pingfangFont(ofSize: PTW(12), weight: .medium)
        tip.textAlignment = .center
        tip.textColor = UIColor.colorWithHex("#FF4D95")
        tip.layer.cornerRadius = PTW(33/2)
        tip.layer.masksToBounds =  true
        return tip
    }()
        
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupHeadUI()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setupHeadUI(){
        addSubview(self.headImg)
        addSubview(self.upLbl)
        self.headImg.snp.makeConstraints { make in
            make.left.equalToSuperview().offset(PTW(10))
            make.right.equalToSuperview().offset(-PTW(10))
            make.top.equalToSuperview().offset(PTW(10))
            make.bottom.equalToSuperview().offset(-PTW(10))
        }
        self.upLbl.snp.makeConstraints { make in
            make.left.equalTo(self.headImg).offset(PTW(17))
            make.right.equalTo(self.headImg).offset(-PTW(17))
            make.height.equalTo(PTW(33))
            make.bottom.equalTo(self.headImg).offset(-PTW(10))
        }
    }
        
}
